home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / Libraries / LinAlg 3.1 / LinAlg / vmatrix.dat < prev    next >
Text File  |  1995-12-21  |  4KB  |  136 lines

  1.  
  2.  
  3. -------------------------------------------------------------------------------
  4.         Verify Operations on Matrices
  5.  
  6.  
  7. ---> Test allocation and compatibility check
  8. The following matrices have been allocated
  9.  
  10. Matrix 1:4x1:20 'Matrix m1'
  11. Matrix 1:4x1:20 'Matrix m2'
  12. Matrix 1:4x0:19 'Matrix m3'
  13. Matrix 1:4x1:20 'Matrix m4'
  14. Status information reported for matrix m3:
  15.   Row lower bound ... 1
  16.   Row upper bound ... 4
  17.   Col lower bound ... 0
  18.   Col upper bound ... 19
  19.   No. rows ...........4
  20.   No. cols ...........20
  21.   No. of elements ....80
  22.   Name Matrix m3
  23.  
  24. Check matrices 1 & 2 for compatibility
  25. Check matrices 1 & 4 for compatibility
  26. m2 has to be compatible with m3 after resizing to m3
  27. m1 has to be compatible with m5 after resizing to m5
  28.  
  29. Matrix 1:5x1:25 'Matrix m5'
  30.  
  31. ---> Test operations that treat each element uniformly
  32. Writing zeros to m...
  33. Creating zero m1 ...
  34. Comparing m1 with 0 ...
  35. Writing a pattern 8.625 by assigning to m(i,j)...
  36. Writing the pattern by assigning to m1 as a whole ...
  37. Comparing m and m1 ...
  38. Comparing (m=0) and m1 ...
  39. Clearing m1 ...
  40.  
  41. Clear m and add the pattern
  42.    add the doubled pattern with the negative sign
  43.    subtract the trippled pattern with the negative sign
  44.  
  45. Verify comparison operations when all elems are the same
  46.  
  47. Verify comparison operations when not all elems are the same
  48.  
  49. Assign 2*pattern to m by repeating additions
  50. Assign 2*pattern to m1 by multiplying by two 
  51. Multiply m1 by one half returning it to the 1*pattern
  52.  
  53. Assign -pattern to m and m1
  54. m = sqrt(sqr(m)); m1 = abs(m1); Now m and m1 have to be the same
  55.  
  56. Check out to see that sin^2(x) + cos^2(x) = 1
  57. Element (16,8) with value 1 differs the most from what
  58. was expected, 1, though the deviation 1.19209e-07 is small
  59.  
  60. Done
  61.  
  62.  
  63. ---> Test Binary Matrix element-by-element operations
  64.  
  65. Verify assignment of a matrix to the matrix
  66.  
  67. Adding the matrix to itself, uniform pattern 4.25
  68.   subtracting two matrices ...
  69.   subtracting the matrix from itself
  70.   adding two matrices together
  71.  
  72. Arithmetic operations on matrices with not the same elements
  73.    adding mp to the zero matrix...
  74.    making m = 3*mp and m1 = 3*mp, via add() and succesive mult
  75.    clear both m and m1, by subtracting from itself and via add()
  76.  
  77. Testing element-by-element multiplications and divisions
  78.    squaring each element with sqr() and via multiplication
  79.    compare (m = pattern^2)/pattern with pattern
  80.  
  81.  
  82. Comparison of two Matrices:
  83.     Original vector and vector after squaring and dividing
  84. Matrix 2:11x0:19 ''
  85. Matrix 2:11x0:19 ''
  86. Maximal discrepancy         0
  87.    occured at the point     (2,0)
  88.  Matrix 1 element is            4.25
  89.  Matrix 2 element is            4.25
  90.  Absolute error v2[i]-v1[i]     0
  91.  Relative error             0
  92.  
  93. ||Matrix 1||            850
  94. ||Matrix 2||            850
  95. ||Matrix1-Matrix2||             0
  96. ||Matrix1-Matrix2||/sqrt(||Matrix1|| ||Matrix2||)   0
  97.  
  98.  
  99. Done
  100.  
  101. ---> Verify norm calculations
  102.  
  103. Assign 10.25 to all the elements and check norms
  104.   1. (col) norm should be pattern*nrows
  105.   Inf (row) norm should be pattern*ncols
  106.   Square of the Eucl norm has got to be pattern^2 * no_elems
  107.  
  108. Done
  109.  
  110. ---> Check creating some special matrices of dimension 20
  111.  
  112. test creating Hilbert matrices
  113. test creating zero matrix and copy constructor
  114. test creating unit matrices
  115. check to see that Haar matrix has *exactly* orthogonal columns
  116. make Haar (sub)matrix and test it *is* a submatrix
  117.  
  118. Done
  119.  
  120. ---> Check making/forcing promises, (lazy)matrices of dimension 20
  121.  
  122. make a promise and force it by a constructor
  123. make a promise and force it by an assignment
  124.  
  125. Done
  126.  
  127. ---> Verify matrix transpose
  128. for matrices of a characteristic size 20
  129.  
  130. Check to see that a square UnitMatrix' stays the same
  131. Test a non-square UnitMatrix
  132. Check to see that a symmetric (Hilbert)Matrix' stays the same
  133. Check transposing a non-symmetric matrix
  134. Check double transposing a non-symmetric matrix
  135. Done
  136.